home *** CD-ROM | disk | FTP | other *** search
- Path: hubcap.clemson.edu!usenet
- From: Stephane Morvan <smorvan@eng.clemson.edu>
- Newsgroups: comp.lang.c++
- Subject: istream/fstream problem with binary data on Unix system
- Date: 10 Jan 1996 22:27:29 GMT
- Organization: Clemson University
- Message-ID: <4d1egh$fts@hubcap.clemson.edu>
- NNTP-Posting-Host: snowwhite.eng.clemson.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1IS (X11; I; IRIX 5.3 IP19)
- X-URL: news:comp.lang.c++
-
- I can't properly extract 50 bytes of raw binary data from a file...
- Eventhough I "unsetf" ios::skipws.
- The data to read looks like that:
- 12 floats + 2 bytes (pad) = 48 bytes + 2 bytes = 50 bytes.
- What I'm doing:
- float data[13];
- fstream myfile("data", ios::in, streambuf::openprot);
- myfile.get((char *)data, 50);
- the binary data looks unproperly transfered to its recipient.
- The same file is working fine with a C program.
- Any help would be welcome...
-
-
- --
- Stephane Morvan
-
-
- *************************************************************************
- * Clemson Design Methodology Group *
- * *
- * Home : (803)-639-3755 Office : (803)-656-7176 *
- * e-mail : smorvan@eng.clemson.edu *
- * WWW : http://www.eng.clemson.edu/dmg/people/morvan.html *
- * *
- *************************************************************************
-
-